setup.js ➔ ???   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
c 2
b 0
f 0
nc 1
nop 0
dl 0
loc 7
rs 9.4285
1
'use strict'
2
3
import mongoose from 'mongoose'
4
import chai from 'chai'
5
import chaiHttp from 'chai-http'
6
import dirtyChai from 'dirty-chai'
7
import { before, after } from 'mocha'
8
9
chai.use(chaiHttp)
10
chai.use(dirtyChai)
11
12
// prepares a clean bank
13
before(() => {
14
  mongoose.connect('mongodb://localhost/devise', (err) => {
15
    if (err) {
16
      throw err
17
    }
18
  })
19
})
20
21
after(() => {
22
  mongoose.connection.dropDatabase()
23
})
24